﻿
using hentity;
using hutil;
using System;
using System.Collections.Generic;
namespace hcache {
    [Serializable]
    public abstract class BaseTask : RAM,ICloneable , CacheData {
       
        public short driveId = 0;

        public BaseTask() {
            className = GetType().Name;
            MyCache.addOver(this);
        }
        public List<long> relyTask = new List<long>();

      
        public String className {
            get; set;
        }
        public bool same(BaseTask o) {
            return o.taskNo == taskNo && o.src == src;
        }

        public abstract void init(CoreTask complete ,CoreTaskParam param ,TaskDto dto);
       

        public virtual bool isFinsh(int stn) {
            return   des == stn  ;
        }

        public virtual int getDes() {
            return des;
        }
        public virtual int getSrc() {
            return src;
        }


       

        public int taskNo {
            get; set;
        }
        public string code {
            get; set;
        }

        public short status {
            get; set;
        }
        public long completeId {
            get; set;
        }
        public long completeParamId {
            get; set;
        }

        public string extra {
            get; set;
        }
        public int src {
            get; set;
        }
        public int des {
            get; set;
        }
        public int ralyForbid {
            get; set;
        }
        public String waveNo {
            get; set;
        }

      
        public abstract List<String> getLableData();
        public object Clone() {
            BaseTask bt = ( BaseTask ) this.MemberwiseClone();
           
            return bt;
        }

        public string getId () {
            return myOrder + "";
        }
    }
}
